import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router);

export const constantRouterMap = [
    {
        path: '/timer',
        component: () => import('@/page/timer/index'),
        meta: {
            title: '定时器',
            icon: 'icon-timer'
        }
    },
    {
      path: '',
      redirect: '/demos'
    },
    {
        path: '/demos',
        component: () => import('@/page/demos'),
        meta: {
            title: '演示组件',
            icon: 'icon-timer'
        }
    },
    {
        path: '/tree_table',
        component: () => import('@/page/table/customTreeTable'),
        meta: {
            title: '演示组件',
            icon: 'icon-timer'
        }
    },
    {
        path: '/tree_table2',
        component: () => import('@/page/table/treeTable2/treeTable2'),
        meta: {
            title: '演示组件',
            icon: 'icon-timer'
        }
    },
    {
        path: '/tree_table3',
        component: () => import('@/page/table/treeTable3/treeTable3'),
        meta: {
            title: '演示组件',
            icon: 'icon-timer'
        }
    },
    {
        path: '/collapse_table',
        component: () => import('@/page/table/collapseTable'),
        meta: {
            title: '演示组件',
            icon: 'icon-timer'
        }
    },
    {
        path: '/slot',
        component: () => import('@/page/slotdemo'),
        meta: {
            title: 'slot演示',
            icon: 'icon-timer'
        }
    },
    {
        path: '/timeline',
        component: () => import('@/page/timeline'),
        meta: {
            title: 'timeline',
            icon: 'icon-timer'
        }
    },
    {
        path: '/list',
        component: () => import('@/page/list'),
        meta: {
            title: '演示组件',
            icon: 'icon-timer'
        }
    },
    {
        path: '/icons',
        component: () => import('@/page/icons'),
        meta: {
            title: 'icons',
            icon: 'icon-timer'
        }
    },
    {
        path: '/svg-icons',
        component: () => import('@/page/svg-icons/index'),
        meta: {
            title: 'icons',
            icon: 'icon-timer'
        }
    },{
        path: '/slot-scope-tests',
        component: () => import('@/page/slots/slot-parent'),
        meta: {
            title: 'icons',
            icon: 'icon-timer'
        }
    }
];

export default new Router({
    scrollBehavior: () => ({ y: 0 }),
    routes: constantRouterMap
})
